package tech.wenxu.ssoprovider.common;

import org.springframework.web.bind.annotation.ControllerAdvice;
import org.springframework.web.bind.annotation.ExceptionHandler;
import org.springframework.web.bind.annotation.ResponseBody;

/**
 * @author zhaowenxu
 * @date 2020/4/13 15:41
 */
@ControllerAdvice
public class ResultAdvice {

    @ExceptionHandler(Throwable.class)
    @ResponseBody
    public SysResult<Void> serviceExceptionHandler(Throwable e) {
        return SysResult.err(e.getMessage());
    }
}
